<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
  ul{
    list-style: none;
  }
  </style>
</head>
<body>
  <header>
    <nav>
        <% if(!user){ %>
  <form action="/work/reg" method="post">
  <input type="text" name="loginName">
  <input type="password" name="loginPassword">
  <input type="password" name="confirm">
  <input type="submit" value="注册">
  </form>
  <form action="/work/login" method="post">
    <input type="text" name="loginName">
    <input type="password" name="loginPassword">
    <%=firstNum%> + <%=secondNum%> = <input type="text" name="Vcode">
    <input type="submit" value="登录">
  </form>
  <%}else{%>
    <h3><%=user%></h3>
      <a href="/work/out">退出登录</a>
  <%}%>
</nav>
</header>
<div class="messageBoard">
  <ul>
    <% message.forEach(item=>{ %>
      <li><%=item.userName%> : <%=item.message%> 留言时间: <%=item.createTime%></li>
    <% }) %>
  </ul>
  <a href="/work/?page=<%=lastPage%>">上一页</a> <a href="/work/?page=<%=nextPage%>">下一页</a>
</div>
<div class="sendMessage">
<form action="work/sendMessage" method="post">
<input type="textarea" name="message">
<input type="submit" value="发送">
</form>
</div>
</body>
</html>
